package com.yonyougov.devops.cruxcisupport.committrace;

import com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTestIdAndStatusDto;
import com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTestIdInStatusInDto;
import com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTraceEntityByInDto;
import com.yonyougov.devops.cruxcisupport.committrace.vo.CommitTraceKeyValueVo;
import com.yonyougov.devops.cruxcisupport.committrace.vo.CommitTracePageVo;
import com.yonyougov.devops.cruxcisupport.committrace.vo.QueryCommitTracePageDto;
import com.yonyougov.devops.fwc.core.dao.BaseDao;

import java.math.BigInteger;
import java.util.List;

/**
 * t_commit_trace数据层
 */
public interface CommitTraceDao extends BaseDao<CommitTraceEntity, BigInteger> {
    //<!--用户自定义代码开始-->

    /**
     * 查询提测历史
     * 条件: 提测单id
     *
     * @param queryCommitTracePageDto [com.yonyougov.devops.cruxcisupport.committrace.vo.QueryCommitTracePageDto]
     * @return [java.util.List: com.yonyougov.devops.cruxcisupport.committrace.vo.CommitTracePageVo]
     */
    List<CommitTracePageVo> findPageBy(QueryCommitTracePageDto queryCommitTracePageDto);

    /**
     * 查询提测历史
     * 条件: 提测单id
     *
     * @param queryCommitTracePageDto [com.yonyougov.devops.cruxcisupport.committrace.vo.QueryCommitTracePageDto]
     * @return [int]
     */
    int countBy(QueryCommitTracePageDto queryCommitTracePageDto);

    /**
     * 根据提测id和状态查询追踪记录
     *
     * @param commitTestIdAndStatusDto com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTestIdAndStatusDto
     * @return java.util.List
     */
    List<CommitTraceEntity> findByCommitTestIdAndStatus(CommitTestIdAndStatusDto commitTestIdAndStatusDto);

    /**
     * 根据提测id和状态查询追踪记录,取每个状态的第一条
     *
     * @param commitTestIdAndStatusDto com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTestIdAndStatusDto
     * @return java.util.List
     */
    List<CommitTraceEntity> findGroupInFristByCommitTestIdAndStatus(CommitTestIdAndStatusDto commitTestIdAndStatusDto);

    /**
     * 根据提测id和状态查询追踪记录,取每个状态的第一条
     *
     * @param commitTestIdInStatusInDto com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTestIdAndStatusDto
     * @return java.util.List
     */
    List<CommitTraceKeyValueVo> findGroupByCommitTestIdStatus(CommitTestIdInStatusInDto commitTestIdInStatusInDto);

    /**
     * 通用in查询
     *
     * @param commitTraceEntityByInDto com.yonyougov.devops.cruxcisupport.committrace.dto.CommitTraceEntityByInDto
     * @return java.util.List
     */
    List<CommitTraceEntity> findByIn(CommitTraceEntityByInDto commitTraceEntityByInDto);
    //<!--用户自定义代码结束-->
}
